#! /usr/bin/env python
# -*- coding: utf-8 -*-

import keyword

def test():
    print(2323)
    print("aaa", end="") # 不换行
    print(keyword.kwlist)
    print(2**5) # 乘方
    print(10000*((1+0.10)**5))

    print("=========================================")
    '''字典'''
    dict = {}
    dict['one'] = "test01"
    dict['2'] = "test02"

    print(dict) # 输出完整的字典
    print(dict.keys()) # 输出所有的键
    print(dict.values()) # 输出所有的值
    dict2 = {x: x ** 2 for x in (2, 4, 6)}
    print("dict2:", dict2)

    print("=========================================")
    '''字符串格式化'''
    print("我叫%s，今年%s岁！" % ('小明', 10))

    print("=========================================")
    '''列表'''
    list = ['google', 'baidu', 'taobao']
    print(list[-1])
    print(list[-2])

    print("=========================================")
    '''集合'''
    set1 = set(("google", "taobao", "facebook"))
    set1.add("huawei") # 添加元素
    print(set1)
    set1.remove("google") # 移除元素，元素不存在会发生错误 KeyError: 'google'
    print(set1)
    set1.discard("google")  # 移除元素，元素不存在不会发生错误
    print(set1)
    print("taobao" in set1) # 判断元素是否在集合中存在

    print("="*40)
    list1 = 'scrapy crawl douban_spider'.split()
    print(type(list1))
    print(list1)

def test2():
    for i in range(1, 45):
        print(i)

if __name__ == '__main__':
    test()
    print("=========================================")
    test2()

# https://www.runoob.com/python3/python3-loop.html
